package com.fengwk.user.face.client;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.fengwk.user.face.client.hystrix.RegisterClientHystrix;
import com.fengwk.user.face.constant.UserServerConstant;
import com.fengwk.user.face.model.User;

@FeignClient(
		name = UserServerConstant.FEIGN_CLIENT_NAME, 
		path = "/api/register",
		fallback = RegisterClientHystrix.class)
public interface RegisterClient {
	
	/**
	 * 注册用户
	 * 
	 * @param avatarId 用户头像id
	 * @param username 用户名
	 * @param email 邮箱
	 * @param mobilePhone 手机号
	 * @param password 密码
	 * @param idCard 身份证
	 * @param sex 性别
	 * @param birthTime 出生时间
	 * @return
	 */
	@PostMapping("/register")
	User register(
			@RequestParam(value = "avatarId", required = false) Long avatarId, 
			@RequestParam(value = "username", required = false) String username, 
			@RequestParam(value = "email", required = false) String email, 
			@RequestParam(value = "mobilePhone", required = false) String mobilePhone, 
			@RequestParam(value = "password", required = false) String password, 
			@RequestParam(value = "nickname", required = false) String nickname,
            @RequestParam(value = "realName", required = false) String realName,
			@RequestParam(value = "idCard", required = false) String idCard, 
			@RequestParam(value = "sex", required = false) Integer sex, 
			@RequestParam(value = "birthTime", required = false) Long birthTime);
	
}
